import request from '@/utils/request'

// 添加检查项
export const addCheckProject = (data) => {
  return request({
    method: 'post',
    url: '/inspection/item/add',
    data,
  })
}

// 查询检查项列表
export const getCheckProjectList = (params) => {
  return request({
    method: 'get',
    url: '/inspection/item/query',
    params,
  })
}

// 获取检查项详情
export const getCheckProjectDetail = (params) => {
  return request({
    method: 'get',
    url: '/inspection/item/get',
    params,
  })
}

// 修改检查项
export const updateCheckProject = (data) => {
  return request({
    method: 'put',
    url: `/inspection/item/update/${data.pkid}`,
    data,
  })
}

// 删除检查项
export const deleteCheckProject = (params) => {
  return request({
    method: 'delete',
    url: `/inspection/item/delete`,
    params,
  })
}

// 导入
export const importCheckProject = (data) => {
  return request({
    method: 'post',
    url: `/inspection/item/import`,
    data,
  })
}

// 导出
export const exportCheckProject = (params) => {
  return request({
    method: 'get',
    url: `/inspection/item/downloadTemplate`,
    params,
    responseType: 'blob',
  })
}
